package com.matchmealpha;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;

public class CustomSideView extends View {
	

	public CustomSideView(Context context, AttributeSet attrs) {
		super(context, attrs);

	}
	
	
	protected void onDraw (Canvas canvas)
	{
		int width = canvas.getWidth(); 
        int height = canvas.getHeight();

        Paint p = new Paint();
        
        p.setARGB(255, 0, 0, 0);
          if(height > width)
          {
        	  int sideLength =  (height - width)/2;
              canvas.drawRect(new Rect(0,0,width,sideLength),p);
              canvas.drawRect(new Rect(0,height-sideLength,width,height),p);

          }else
          {
        	  int sideLength =  (width - height)/2;
        	  canvas.drawRect(new Rect(0,0,sideLength,height),p);
              
              canvas.drawRect(new Rect(width-sideLength,0,width,height),p);
        	  
          }
	}
}
